package com.redis.example.pub;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

/**
 * @Author: liuchengcheng
 * @Date: 2021/10/25 11:01
 */
@Service
public class PubService {
    @Autowired
    private StringRedisTemplate stringRedisTemplate;
    public void saveMessageToQueue(String queue, String content){
        stringRedisTemplate.convertAndSend(queue,content);
    }
}
